<template>
    <view class="">
        <input type="text" v-model="person.name"/>
    </view>
	{{person}}
</template>

<script setup>
import { ref, watch } from 'vue';

    const person = ref({
		name:'张三',
		age:23
	})
	
	// 浅监听
	// watch(person,(newValue, oldValue)=>{
	// 	console.log(newValue);
	// 	console.log(oldValue);
	// })
	
	// 监听对象的一个属性
	// watch(()=>person.value.name,(newValue, oldValue)=>{
	// 	console.log(newValue);
	// 	console.log(oldValue);
	// })
	
	// watch(person,(newValue)=>{
	// 	console.log("deepnew-" + newValue.name);
	// },{deep:true, immediate:true})
	
</script>

<style lang="scss" scoped>

</style>
